var e = require;
var t = module;
window.LevelSceneManager = {
    Instance: null
};
var n = cc.Enum({
    Lobby: 0,
    KingStoryLobby: 1
}),
o = cc.Enum({
    King: 0,
    WC: 1,
    Love: 2,
    BadKing_Girl: 3,
    Dancer: 4
});
t.exports = {
    GameSceneBlockPrefabType: n,
    GameStorySceneType: o
};
cc.Class({
    extends: cc.Component,
    properties: {
        CreatSceneBlockInterval: 5300,
        ScenesObjectParent: cc.Node,
        isCreateScene: !1,
        GameSceneBlockPrefabs: {
            type: [cc.Prefab],
            default: []
        },
        GameCurrentSceneObjects: {
            type: [cc.Node],
            default: []
        },
        GameStorySceneObjects: {
            type: [cc.Node],
            default: []
        }
    },
    onLoad: function() {
        LevelSceneManager.Instance = this
    },
    CreateNextScene: function(e) {
        var t = this;
        if (!this.isCreateScene) {
            this.isCreateScene = !0;
            this.scheduleOnce(function() {
                t.isCreateScene = !1
            },
            1);
            var n;
            n = null != this.GameCurrentSceneObjects[1] ? this.GameCurrentSceneObjects[1].position: this.GameCurrentSceneObjects[0].position;
            var o = cc.instantiate(this.GameSceneBlockPrefabs[e]);
            o.parent = this.ScenesObjectParent;
            o.x += n.x + this.CreatSceneBlockInterval;
            o.setSiblingIndex(0);
            if (null != this.GameCurrentSceneObjects[0] && null != this.GameCurrentSceneObjects[1]) {
                this.GameCurrentSceneObjects[0].destroy();
                this.GameCurrentSceneObjects[0] = this.GameCurrentSceneObjects[1];
                this.GameCurrentSceneObjects[1] = o
            } else this.GameCurrentSceneObjects[1] = o
        }
    },
    StartStoryScene: function(e) {
        LevelManager.Instance.onGameOver();
        this.GameStorySceneObjects[e].active = !0
    }
})